﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TimeForing.Models;
using System.Web.Mvc;

namespace TimeForing.Controllers
{
    public class TaskFormViewModel
    {
        public Task Task { get; private set; }
        public List<SelectListItem > Sprint { get; private set; }
        public List<SelectListItem> User { get; private set; }
        public List<SelectListItem> Code { get; private set; }
        public List<SelectListItem> Story { get; private set; }
        
        public TaskFormViewModel(Task task)
        {
            TimeforingRepository repo = new TimeforingRepository();
            Task = task;

            Sprint = repo.GetSprintListFromTask (Task );
            User = repo.GetUsersForTask (Task.TaskID  );
            Code = repo.GetCodesForTask (Task);
            Story = repo.GetStorysForTask (Task.TaskID );
        }
    }
}
